<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>xchange</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab Function</center>
    <div align="right">Last update : April 1993</div>
    <p>
      <b>xchange</b> -  transform real to pixel coordinates</p>
    <h3>
      <font color="blue">Calling Sequence</font>
    </h3>
    <dl>
      <dd>
        <tt>[x1,y1,rect]=xchange(x,y,dir)  </tt>
      </dd>
    </dl>
    <h3>
      <font color="blue">Parameters</font>
    </h3>
    <ul>
      <li>
        <tt>
          <b>x,y</b>
        </tt>: two matrices of size (n1,n2) (coordinates of a set of points).</li>
      <li>
        <tt>
          <b>x1,y1</b>
        </tt>: two matrices of size (n1,n2) (coordinates of the set of points).</li>
      <li>
        <tt>
          <b>rect</b>
        </tt>: a vector of size 4.</li>
    </ul>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>
    After having used a graphics function, <tt>
        <b>xchange</b>
      </tt> computes pixel
    coordinates from real coordinates and conversely, 
    according to the value of the parameter <tt>
        <b>dir</b>
      </tt>:
    "f2i" (float to int) means real to pixel and "i2f" (int to float)
    means pixel to real.
    <tt>
        <b>x1</b>
      </tt> and <tt>
        <b>y1</b>
      </tt> are the new coordinates of the set of points 
    defined by the old coordinates <tt>
        <b>x</b>
      </tt> and <tt>
        <b>y</b>
      </tt>.</p>
    <p>
      <tt>
        <b>rect</b>
      </tt> is the coordinates in pixel
    of the rectangle in which the plot was done: [upper-left point,
    width, height].</p>
    <h3>
      <font color="blue">Examples</font>
    </h3>
    <pre>

t=[0:0.1:2*%pi]';
plot2d(t,sin(t))
[x,y,rect]=xchange(1,1,"f2i")
[x,y,rect]=xchange(0,0,"i2f")
 
  </pre>
    <h3>
      <font color="blue">Author</font>
    </h3>
    <p>J.Ph.C.  </p>
  </body>
</html>
